home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
gnu
/
gawk
/
gawk213b.zoo
/
test
/
sortdir1.awk
< prev
next >
Wrap
Text File
|
1991-04-06
|
395b
|
20 lines
#
# A demo of using your own temporary files with gawk
# Use as in 'gawk -f sortdir1.awk > outs'
#
# !!! WILL CREATE (OR OVERWRITE) FILE ls.tmp -- WATCH OUT !!!
#
BEGIN {
cmd1 = "ls -l"
cmd2 = "sort -n +3"
tmpfile = "ls.tmp"
while ((cmd1 | getline) > 0)
print $0 > tmpfile
close (cmd1)
close (tmpfile)
while ((getline < tmpfile) > 0)
print $0 | cmd2
close (cmd2)
close (tmpfile)
}